import Store from 'electron-store';

// store
const store = new Store({
    schema: {
        openAtLogin: {
            type: 'boolean',
            default: false,
        },
        theme: {
            type: "string",
            default: "system"
        },
        apps: {
            type: "object",
            default: {}
        }
    }
});

const set = (key: string, obj: any) => {
    store.set(key, obj);
}

const get = (key: string, defaultValue?: any) => {
    store.get(key, defaultValue);
}

const all = () => {
    store.store;
}
export default { set, get, all } 